package com.zhisheng.day10_tlias.dto;

import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.time.LocalDate;

/*
    根据前端传递的参数,自行封装的一个专门用于接收参数的对象
 */

@Data
@AllArgsConstructor
@NoArgsConstructor
public class EmpQueryDto {
    private String name;
    private Short gender;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate begin;
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private LocalDate end;

    private Integer page = 1;
    private Integer pageSize = 10;

    // 专门写一个根据当前页计算起始索引的方法,以便于,mapper层调用使用
   /* public int getStartRow(){
        System.out.println("计算起始索引的方法被调用了...............................................................................................................");
        return (page-1)*pageSize;
    }*/

}
